﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace UCS.ArtificialInteligence.CitiesProblem.Model
{
    public class State : INotifyPropertyChanged
    {
        #region Attributes and Properties

        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;

                RaiseProperyChanged("Name");
            }
        }

        private ObservableCollection<City> _cities;
        public ObservableCollection<City> Cities
        {
            get { return _cities; }
            set
            {
                _cities = value;

                RaiseProperyChanged("Cities");
            }
        }

        #endregion

        #region Events

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region Constructors

        public State(string name)
        {
            _name = name;
            _cities = new ObservableCollection<City>();
        }

        #endregion

        #region Private Methods

        private void RaiseProperyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion
    }
}
